The following relates generally to techniques for determining the orientation of a mobile device, particularly in an X-Y plane (e.g., parallel to the earth's surface). Many mobile devices (e.g., cellular devices, computers, vehicles, robotic machines, etc.) include a compass for determining the mobile device's orientation in an X-Y plane. However, when a mobile device is used, for example, in an indoor environment, magnetic influences from large metal structures, such as metal structures inside walls, floors, and/or furniture, can interfere with the compass' ability to accurately measure the earth's magnetic flux. Although a mobile device's compass may provide an approximately correct orientation of the mobile device in an indoor environment, a more accurate orientation may be needed for some navigation purposes (e.g., for directing a user of the mobile device to an object and/or location in a store; for directing a user of the mobile device to targeted advertising; for steering a robotic machine; etc.).